package com.csair.seam.domain.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csair.seam.domain.mapper.InventoryMapper;
import com.csair.seam.domain.model.entity.Inventory;
import com.csair.seam.domain.model.entity.InventoryFeedback;
import com.csair.seam.domain.model.entity.InventoryRecord;
import com.csair.seam.domain.model.entity.LocationTreeNode;
import com.csair.seam.domain.model.param.EquipParam;
import com.csair.seam.domain.service.IInventoryService;

@Service
public class InventoryServiceImpl implements IInventoryService {
	
	@Autowired
	private InventoryMapper inventoryMapper;

	@Override
	public Page<Inventory> findInventoryPage(EquipParam param) {
		Page<Inventory> page = new Page<>(param.getPageIndex(), param.getPageSize());
		page =inventoryMapper.findInventoryPage(page, param);
		return page;
	}
	
	@Override
	public Inventory findInventoryById(String id) {
		return inventoryMapper.findInventoryById(id);
	}
	
	@Override
	public List<Inventory> findInventoryByIds(List<String> ids) {
		return inventoryMapper.findInventoryByIds(ids);
	}

	@Override
	public int updateInventory(InventoryFeedback feedback) {
		return inventoryMapper.updateInventory(feedback);
	}

	@Override
	public int updateRevoke(String id) {
		return inventoryMapper.updateRevoke(id);
	}

	@Override
	public List<InventoryRecord> findInventoryRecord(EquipParam param) {
		return inventoryMapper.findInventoryRecord(param);
	}

	@Override
	public List<Inventory> findInventoryEhomeNoticeList() {
		return inventoryMapper.findInventoryEhomeNoticeList();
	}

	@Override
	public int updateInventoryNotice(List<String> ids) {
		return inventoryMapper.updateInventoryNotice(ids);
	}

	@Override
	public List<LocationTreeNode> findLocationTree(String fkParent) {
		return inventoryMapper.findLocationTree(fkParent);
	}

	@Override
	public List<LocationTreeNode> findLocationNodeList(String fkParent) {
		return inventoryMapper.findLocationNodeList(fkParent);
	}

}
